package com.link2room.bumblebee.facade.impl;

import com.link2room.bumblebee.dto.param.base.TagBaseParamDto;
import com.link2room.bumblebee.dto.result.base.TagBaseDto;
import com.link2room.bumblebee.entity.TagBase;
import com.link2room.bumblebee.facade.ITagBaseFacadeService;
import com.link2room.common.jpa.result.QueryResult;
import com.link2room.common.service.ICommonService;
import com.link2room.common.util.ClassConverUtil;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author sqj88
 * @date 2017/11/17 20:41
 */
@Component("tagBaseFacadeService")
public class TagBaseFacadeServiceImpl implements ITagBaseFacadeService {
    @Resource
    private ICommonService commonService;

    @Override
    public QueryResult<TagBaseDto> listTagBases(TagBaseParamDto tagBaseParamDto)throws Exception{
        TagBase queryTag=new TagBase();
        queryTag.setLhotelGroupCode(tagBaseParamDto.getLhotelGroupCode());
        queryTag.setTagType(tagBaseParamDto.getTagType());
        QueryResult<TagBase> tagBaseQueryResult = commonService.findAllEQ(TagBase.class, queryTag);
        return ClassConverUtil.copyQueryResultToDtoQueryResult(tagBaseQueryResult, TagBaseDto.class,false);
    }
}
